/********************************************************
 Name          : common_def.h
 Author        : Khachatur Gyozalyan
 Copyright     : Copyright by Antel Systems
 Description   :
 **********************************************************/
#ifndef COMMON_DEF_H_
#define COMMON_DEF_H_

// Include Files
#include "usart_fast.h"
//#include "printf-stdarg.h"
#include <stdarg.h>//iiiiiiiiiiiiiiiiiiiiii
#include "power_clocks_lib.h"
#include "flashc.h"
#include "wdt.h"
#include "stdio.h"
#include "AntelCfgOID.h"

struct VersionStruct
{
  struct VerHW_SW
  {
	  unsigned char ProductModel[SIZEOF_MODEL+1];//PRODUCT_ID
	  unsigned char Description[SIZEOF_DESCRIPTION+1];
	  unsigned char PCBA_Rev_Ver[SIZEOF_PCBA_VERSION+1];//HARDWARE_ID
	  unsigned char EmbSoftImageVer[SIZEOF_SOFTWARE_VERSION+1];//RUNTIME_SOFTWARE
	  unsigned char GMSKImageVer[SIZEOF_GMSK_IMAGE_VERSION+1];
	  unsigned char FSKImageVer[SIZEOF_FSK_IMAGE_VERSION+1];
	  unsigned char QAMImageVer[SIZEOF_QAM_IMAGE_VERSION+1];
	  unsigned char ZigBeeImageVer[SIZEOF_ZIGBEE_IMAGE_VERSION+1];
  } HW_SW;

  struct VerSysID
  {
	  unsigned char SN_MAC[SIZEOF_SERIAL_NUMBER_MAC+1];//PRODUCT_SN
	  unsigned char Manufactor_SN[SIZEOF_MANUFACTORING_SERIAL_NUMBER+1];//MFG_SN
  } SysID;
};
struct VersionStruct  ANTEL_VERSION;

#define  BOOT_OPTION_USER           1
#define  BOOT_OPTION_DEFAULT        2
#define  BOOT_OPTION_PERM_DEFAULT   3

#define USER_BOOT_VALUE          0x11CC
#define DEFAULT_BOOT_VALUE       0x2233
#define PERM_DEFAULT_BOOT_VALUE  0x4466

void initial_version_struct(void);
void print_version_info(void);
void Reset_MCU(void);
void Set_boot_option(int option);
int Get_boot_option(void);

#endif /* COMMON_DEF_H_ */
